//
//  YLDiscoveryHeader.m
//  YLFinanceService
//
//  Created by she1323 on 2017/8/31.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLDiscoveryHeader.h"
#import "YLAccountTool.h"


@interface YLDiscoveryHeader()
@property (weak, nonatomic) IBOutlet UILabel *invitingFriendsLabel;
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@property (weak, nonatomic) IBOutlet UILabel *phoneNumberLabel;
@property (weak, nonatomic) IBOutlet UIView *baseView;
@end

@implementation YLDiscoveryHeader

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    _integralMallSubject = [RACSubject subject];
    _memberCenterSubject = [RACSubject subject];
    _phoneNumberLabel.text = [YLAccountTool account].userName;
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
    _invitingFriendsLabel.userInteractionEnabled = YES;
    [_invitingFriendsLabel addGestureRecognizer:tap];
    _invitingFriendsSingal = tap.rac_gestureSignal;
    
    UITapGestureRecognizer *iconTap = [[UITapGestureRecognizer alloc] init];
    _icon.userInteractionEnabled = YES;
    [_icon addGestureRecognizer:iconTap];
    _myInfoSingal = iconTap.rac_gestureSignal;
    
}

// 会员中心
- (IBAction)memberCenter:(UIButton *)sender {
    [_memberCenterSubject sendNext:nil];
}

// 积分商城
- (IBAction)integralMall:(UIButton *)sender {
    [_integralMallSubject sendNext:nil];
}


-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    
    UIView* view = [super hitTest:point withEvent:event];
    //    if ([view isKindOfClass:[UIButton class]])
    //    {
    //        return view;
    //    }
    return view;
}

@end
